<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:include="common/common::jscss"/>
<body>

<div class="layui-fluid">
    <blockquote class="layui-crumb">
        <a lay-href="/channel/list.action">渠道管理</a>&nbsp;/&nbsp;
        <zmn th:text="${obj.name}"/>&nbsp;/&nbsp;
        <zmn th:text="服务产品">服务产品</zmn>
    </blockquote>

    <div class="layui-card">
        <div th:replace="channel/_tab::tab"></div>

        <fieldset class="layui-elem-field">
            <div class="layui-field-box" style="color: #9F9F9F;">
                请先开通分类，才可开通分类下对应产品；若二级渠道的开通分类未设置，则此处将继承上级渠道配置；修改后会有5分钟缓存；渠道产品映射请使用前台产品
            </div>
        </fieldset>

        <form method="POST" class="layui-form" id="zmn-form" th:action="|/channel/servProductList.action?channelId=${obj.channelId}|">
            <input type="hidden" id="channelId" name="channelId" th:value="${obj.channelId}"/>
            <input type="hidden" name="addFlag" th:value="${addFlag}"/>
            <div th:replace="channel/servproduct/_query::query"/>
        </form>
        <div class="layui-card-body">
            <div th:replace="channel/servproduct/_table::table"/>

            <script type="text/html" id="zmn-table-tool">
                <div class="layui-btn-container">
                    <zmn th:if="${#authPermit.checkPermit('/channel/servProduct/updateStatus.action')}">
                        <div class="layui-btn-group">
                            <button class="layui-btn layui-btn-sm" lay-event="start">开通</button>
                            <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="stop">停用</button>
                        </div>
                    </zmn>

                    <div class="layui-btn-group">
                        <a class="layui-btn layui-btn-sm layui-btn-primary" th:lay-href="|/categ/list.action|">渠道产品属性</a>
                        <a class="layui-btn layui-btn-sm layui-btn-primary" lay-text="新增渠道产品" th:lay-href="|/product/addEditView.action?productType=2&channelId=${channelId}|">+新增渠道产品</a>
                    </div>

                </div>
            </script>
        </div>
    </div>
</div>
</body>
</html>

<script type="text/javascript" th:inline="javascript">

    let json = {
        totalCount: [[${vo.totalCount}]],
        pageSize: [[${vo.pageSize}]],
        pageIndex: [[${vo.pageIndex}]],
        channelId: [[${channelId}]],
        vo: [[${vo}]],
        items: [[${items}]],
        hasViewMapList: [[${#authPermit.checkPermit('/channel/product/map/list.action')}]]
    };
    layui.config({
        base: "/static/lay/",
        version: 20191111
    }).extend({
        index: "lib/index",
        channel_servproduct_list: "channel/servproduct/zmn.plat.channel.servproduct.list",
    }).use(['index', 'channel_servproduct_list']);
</script>